﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Jzy.Workflow.Flow;

namespace Jzy.Workflow.Task
{
    public partial class FlowTaskInfo
    {
        public const string TABLE_NAME = "FlowTask";
        public const string INSERT_SQL = "insert into FlowTask ( [ID], [PreTaskID], [FlowID], [FormID], [SendID], [SendName], [SendTime], [ReceiveID], [ReceiveName], [ReadTime], [FinishTime], [Result], [SendNodeID], [SendNodeName], [ReceiveNodeID], [ReceiveNodeName], [FromType], [State]) values ( @ID, @PreTaskID, @FlowID, @FormID, @SendID, @SendName, @SendTime, @ReceiveID, @ReceiveName, @ReadTime, @FinishTime, @Result, @SendNodeID, @SendNodeName, @ReceiveNodeID, @ReceiveNodeName, @FromType, @State)";
        public const string UPDATE_SQL = "update FlowTask set  [ID] = @ID, [PreTaskID] = @PreTaskID, [FlowID] = @FlowID, [FormID] = @FormID, [SendID] = @SendID, [SendName] = @SendName, [SendTime] = @SendTime, [ReceiveID] = @ReceiveID, [ReceiveName] = @ReceiveName, [ReadTime] = @ReadTime, [FinishTime] = @FinishTime, [Result] = @Result, [SendNodeID] = @SendNodeID, [SendNodeName] = @SendNodeName, [ReceiveNodeID] = @ReceiveNodeID, [ReceiveNodeName] = @ReceiveNodeName, [FromType] = @FromType, [State] = @State where ID = @ID";
        /// <summary>
        /// PK
        /// </summary>
        public Guid ID
        {
            get;
            set;
        }
        /// <summary>
        /// 上一任务的ID,为null表示为顶级
        /// </summary>
        public Guid? PreTaskID
        {
            get;
            set;
        }
        /// <summary>
        /// 节点ID
        /// </summary>
        public Int32 FlowID
        {
            get;
            set;
        }
        /// <summary>
        /// 表单ID
        /// </summary>
        public Int32 FormID
        {
            get;
            set;
        }
        /// <summary>
        /// 发送者的ID
        /// </summary>
        public Int32 SendID
        {
            get;
            set;
        }
        /// <summary>
        /// 发送者姓名
        /// </summary>
        public String SendName
        {
            get;
            set;
        }
        /// <summary>
        /// 发送时间(到达时间)
        /// </summary>
        public DateTime SendTime
        {
            get;
            set;
        }
        /// <summary>
        /// 接收人的ID
        /// </summary>
        public Int32 ReceiveID
        {
            get;
            set;
        }
        /// <summary>
        /// 接收人姓名
        /// </summary>
        public String ReceiveName
        {
            get;
            set;
        }
        /// <summary>
        /// 阅读时间
        /// </summary>
        public DateTime? ReadTime
        {
            get;
            set;
        }
        /// <summary>
        /// 完成时间
        /// </summary>
        public DateTime? FinishTime
        {
            get;
            set;
        }
        /// <summary>
        /// 处理结果
        /// </summary>
        public String Result
        {
            get;
            set;
        }
        /// <summary>
        /// 发送方的节点ID
        /// </summary>
        public Int32 SendNodeID
        {
            get;
            set;
        }
        /// <summary>
        /// 发送方的节点ID
        /// </summary>
        public String SendNodeName
        {
            get;
            set;
        }
        /// <summary>
        /// 接收方所在节点的ID
        /// </summary>
        public Int32 ReceiveNodeID
        {
            get;
            set;
        }
        /// <summary>
        /// 接收方所在节点的名字
        /// </summary>
        public String ReceiveNodeName
        {
            get;
            set;
        }
        /// <summary>
        /// 产生任务的方式（新建、流转、加签、传阅、退回）
        /// </summary>
        public Int32 FromType
        {
            get;
            set;
        }
        /// <summary>
        /// 待处理、存草稿(只有拟稿时才可能)、已完成
        /// </summary>
        public Int32 State
        {
            get;
            set;
        }
    }


}
